package com.ylxin.webflux.service;

import com.ylxin.webflux.pojo.User;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;

/**
 * @author 29048
 * @version V1.0
 * @Project webflux01
 * @Package com.ylxin.webflux.service
 * @Description: Create by 杨立新 @Date 2022/9/22 16:00
 */
public interface UserService {
    //根据 id 查询用户
    Mono<User> getUserById(int id);
    //查询所有用户
    Flux<User> getAllUser();
    //查询所有用户一条一条的查询
    Flux<User> getUsersStream();
    //添加用户
    Mono<Void> saveUserInfo(Mono<User> user);

    //根据 id 查询用户
    User getUserById2(int id);
    //查询所有用户
    List<User> getAllUser2();
    //添加用户
    void saveUserInfo2(User user);
}
